<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>自定义报表管理</title>
<link href="/css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript" src="http://pic2.58.com/n/tuan/js/jquery-1.4.2.min.js"></script>
<script >
			$(function(){$("#clear").click(function(){ 
					$("#reportName").val("");
					$("#reportCate1").val("");
					$("#reportCate2").val("");
                })
             })
			 
			 
			 function updateState(id,upstate){
			 	jQuery.ajax({
        			url:"/intreport/irmain/changestate",
            		type:"post",
            		async:true,
            		data:{"upstate":upstate,"id":id},
            		success:function(data){
                		if(data == "error"){
							alert("更新失败！");
						}else if(data == "success"){
							alert("更新成功！");
							document.searchUser.submit();
						}
            		}
            	});
			 }
			 
			 $(function(){$("#addnewreport").click(function(){ 
			 	window.location.href="toaddnewreport";
			 })
		 })
</script>
<div class="lr_both">
<div class="right_conts">
  <div class="mg_tt">
    <div class="right_search">
      <div class="rs_title_bg">
        <h2 class="rs_title">自定义报表管理</h2>
      </div>
	  </br>
	  <form id="searchUser" name="searchUser" action="/intreport/irmain/irmanager" method="post">
      <div class="rs_div">
		<input type="hidden" id="pageindex" name="pageindex" value="$!{pageIndex}"/>
        <div class="pd_text">报表名</div>
        <div class="input_div">
          <input  class="input_text" name="reportName" id="reportName" type="text" value="$!{reportName}"></input>
        </div>
        <div class="pd_text">类别1</div>
        <div class="input_div">
          <input  class="input_text" name="reportCate1" id="reportCate1" type="text" value="$!{reportCate1}"></input>
        </div>
		  <div class="pd_text">类别2</div>
        <div class="input_div">
          <input  class="input_text" name="reportCate2" id="reportCate2" type="text" value="$!{reportCate2}"></input>
        </div>
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="submit" name="search" id="search" value="查询"/>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" id="clear" name="clear"  value="清空条件"/>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" id="addnewreport" name="addnewreport" value="新增报表"/>
      </div>
	   </form>
    </div>
    <div class="table_div">

      <table class="sj_tl sj_tl_2" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <th align="center" colspan="7">报表列表</th>
        </tr>
		<tr style="background:#ffd9b5;">
           <td align="center" >编号</td>
		   <td align="center" >报表名称</td>
		   <td align="center" >类别1</td>
		   <td align="center" >类别2</td>
		   <td align="center" >创建者</td>
		   <td align="center" >创建时间</td>
		   <td align="center" >操作</td>
        </tr>
		#if($rsList)
            #foreach($rs in $rsList)
    		<tr onMouseOver="this.className='tdbg10'" onMouseOut="this.className='tdbg11'" class="tdbg11">
               <td align="center" >$rs.id</td>
    		   <td align="center" >$rs.reportName</td>
               <td align="center" >$!{rs.reportCate1}</td>
			   <td align="center" >$!{rs.reportCate2}</td>
        	   <td align="center" >$rs.creater</td>
       		   <td align="center" >$rs.creatTime</td>
               <td align="center" id="reportstate" name="reportstate" >
				#if($rs.state == 1)
					<a style="color:green" href="/intreport/irmain/editreport?id=$!{rs.id}">修改</a> &nbsp &nbsp 
					<a style="color:red" onclick="updateState('$rs.id','0')">失效</a>
				#elseif($rs.state == 0)
					<a style="color:blue" onclick="updateState('$rs.id','1')">恢复</a>
				#end
			   </td>
            </tr>
			#end
		#end
      </table>
	  </br>
	   <div align="right">
        #parse("/views/default/page.vm")
        #pagebar($pList "/intreport/irmain/irmanager?#page#&$paramurl")
	   </div>
    </div>


  </div>

</div>
</div>
</body>
</html>
